export default [
  {
    label: '姓名',
    type: 'input',
    key: 'name',
    props: {
      placeholder: '请输入姓名'
    }
  },
  {
    label: '年龄',
    type: 'number',
    key: 'age',
    props: {
      placeholder: '请输入年龄'
    }
  },
  {
    label: '民族',
    type: 'select',
    key: 'nation',
    props: {
      placeholder: '请选择民族'
    },
    options: [
      {
        label: '汉族',
        value: '01'
      },
      {
        label: '满族',
        value: '02'
      }
    ]
  },
  {
    label: '时间',
    type: 'time',
    key: 'time',
    props: {
      placeholder: '请选择时间'
    }
  },
  {
    label: '日期',
    type: 'date',
    key: 'date',
    props: {
      placeholder: '请选择日期'
    }
  },
  {
    label: '单选',
    type: 'radio',
    key: 'radio',
    span: 12,
    props: {
      placeholder: '请选择'
    },
    options: [
      {
        label: '0',
        text: '否'
      },
      {
        label: '1',
        text: '是'
      }
    ]
  },
  {
    label: '多选',
    type: 'checkbox',
    key: 'checkbox',
    span: 12,
    props: {
      placeholder: '请选择'
    },
    options: [
      {
        label: '0',
        text: '红',
        props: {
          disabled: true
        }
      },
      {
        label: '1',
        text: '绿'
      },
      {
        label: '2',
        text: '蓝'
      }
    ]
  },
  {
    label: '级联',
    type: 'cascader',
    key: 'cascader',
    span: 24,
    props: {
      placeholder: '请选择',
      props: {
        lazy: true,
        lazyLoad (node, resolve) {
          let id = 0
          const { level } = node
          setTimeout(() => {
            const nodes = Array.from({ length: level + 1 })
              .map(() => ({
                value: ++id,
                label: `选项${id}`,
                leaf: level >= 2
              }))
            // 通过调用resolve将子节点数据返回，通知组件数据加载完成
            resolve(nodes)
          }, 1000)
        }
      }

    }
  }
]
